package com.ming.stringstudy.feedbacksystem.controller;

import com.ming.stringstudy.feedbacksystem.entity.Evaluation;
import com.ming.stringstudy.feedbacksystem.pojo.Result;
import com.ming.stringstudy.feedbacksystem.service.IEvaluationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 评价表 前端控制器
 * </p>
 *
 * @author aming
 * @since 2024-12-24
 */
@Slf4j
@RestController
@RequestMapping("/evaluations")
public class EvaluationController {
    @Autowired
    IEvaluationService evaluationService;

    @PostMapping("/{commentId}")
    public Result insertEvaluation(@PathVariable("commentId") Integer commentId, @RequestBody Evaluation evaluation) {
        log.info("commentId:{}", commentId);
        log.info("evaluation:{}", evaluation);
        evaluationService.insertEavluation(commentId,evaluation);
        return Result.success();
    }
}
